<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <el-button type="primary" size="small" class="btn" @click="addDialog">添加</el-button>
        <!-- 列表 -->
        <v-list @edit="edit"></v-list>
        <!-- 弹框 -->
        <v-dialog :seckInfo="seckInfo" @cancel="cancel" ref="dialogRef"></v-dialog>
    </div>
</template>
<script>
import vList from './list.vue'
import vDialog from './dialog.vue'
export default {
    data() {
        return {
            seckInfo:{
                isShow:false,
                isAdd:true
            }
        }
    },
    methods: {
        // 打开弹框
        addDialog(){
            this.seckInfo.isShow=true
            this.seckInfo.isAdd=true
        },
        // 关闭弹窗
        cancel(e){
            this.seckInfo.isShow=e
        },
        // 编辑弹框
        edit(e){
            this.seckInfo.isShow=true
            this.seckInfo.isAdd=false
            this.$refs.dialogRef.lookup(e)
        }
    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {
        vList,
        vDialog
    }
}
</script>
<style scoped>
.btn {
    margin: 15px;
}
</style>